3.5.44 \(\int \frac {\tan (c+d x)}{a+b \sin ^2(c+d x)} \, dx\) [444]

Optimal. Leaf size=43 \[ -\frac {\log (\cos (c+d x))}{(a+b) d}+\frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 (a+b) d} \]

[Out]

-ln(cos(d*x+c))/(a+b)/d+1/2*ln(a+b*sin(d*x+c)^2)/(a+b)/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3273, 36, 31} \begin {gather*} \frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 d (a+b)}-\frac {\log (\cos (c+d x))}{d (a+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + b*Sin[c + d*x]^2),x]

[Out]

-(Log[Cos[c + d*x]]/((a + b)*d)) + Log[a + b*Sin[c + d*x]^2]/(2*(a + b)*d)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 3273

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[x^((m - 1)/2)*((a + b*ff*x)^p/(1 - ff*x)^((m
 + 1)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\tan (c+d x)}{a+b \sin ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {1}{(1-x) (a+b x)} \, dx,x,\sin ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \frac {1}{1-x} \, dx,x,\sin ^2(c+d x)\right )}{2 (a+b) d}+\frac {b \text {Subst}\left (\int \frac {1}{a+b x} \, dx,x,\sin ^2(c+d x)\right )}{2 (a+b) d}\\ &=-\frac {\log (\cos (c+d x))}{(a+b) d}+\frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 (a+b) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 37, normalized size = 0.86 \begin {gather*} \frac {-2 \log (\cos (c+d x))+\log \left (a+b-b \cos ^2(c+d x)\right )}{2 a d+2 b d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + b*Sin[c + d*x]^2),x]

[Out]

(-2*Log[Cos[c + d*x]] + Log[a + b - b*Cos[c + d*x]^2])/(2*a*d + 2*b*d)

________________________________________________________________________________________

Maple [A]
time = 0.38, size = 42, normalized size = 0.98

method result size
derivativedivides \(\frac {\frac {\ln \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}{2 a +2 b}-\frac {\ln \left (\cos \left (d x +c \right )\right )}{a +b}}{d}\) \(42\)
default \(\frac {\frac {\ln \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}{2 a +2 b}-\frac {\ln \left (\cos \left (d x +c \right )\right )}{a +b}}{d}\) \(42\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{4 i \left (d x +c \right )}-\frac {2 \left (2 a +b \right ) {\mathrm e}^{2 i \left (d x +c \right )}}{b}+1\right )}{2 d \left (a +b \right )}\) \(65\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+sin(d*x+c)^2*b),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/2/(a+b)*ln(a+b-b*cos(d*x+c)^2)-1/(a+b)*ln(cos(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.32, size = 43, normalized size = 1.00 \begin {gather*} \frac {\frac {\log \left (b \sin \left (d x + c\right )^{2} + a\right )}{a + b} - \frac {\log \left (\sin \left (d x + c\right )^{2} - 1\right )}{a + b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*(log(b*sin(d*x + c)^2 + a)/(a + b) - log(sin(d*x + c)^2 - 1)/(a + b))/d

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 37, normalized size = 0.86 \begin {gather*} \frac {\log \left (-b \cos \left (d x + c\right )^{2} + a + b\right ) - 2 \, \log \left (-\cos \left (d x + c\right )\right )}{2 \, {\left (a + b\right )} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(log(-b*cos(d*x + c)^2 + a + b) - 2*log(-cos(d*x + c)))/((a + b)*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan {\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(tan(c + d*x)/(a + b*sin(c + d*x)**2), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 110 vs. \(2 (41) = 82\).
time = 0.48, size = 110, normalized size = 2.56 \begin {gather*} \frac {\frac {\log \left (a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {4 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a + b} - \frac {2 \, \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{a + b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(log(a - 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 4*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + a*(cos(d*
x + c) - 1)^2/(cos(d*x + c) + 1)^2)/(a + b) - 2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1))/(a + b))/
d

________________________________________________________________________________________

Mupad [B]
time = 14.51, size = 28, normalized size = 0.65 \begin {gather*} \frac {\ln \left (\left (a+b\right )\,{\mathrm {tan}\left (c+d\,x\right )}^2+a\right )}{d\,\left (2\,a+2\,b\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)/(a + b*sin(c + d*x)^2),x)

[Out]

log(a + tan(c + d*x)^2*(a + b))/(d*(2*a + 2*b))

________________________________________________________________________________________